﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;

namespace KduneeShaders.PostProcess
{
    /// <summary>
    /// Shader regulujący nasycenie kolorów obrazu
    /// </summary>
    public class SaturationPostProcess : PostProcessShader
    {
        /// <summary>
        /// Współczynnik regulacji nasycenia - 1.0 oznacza brak zmian
        /// </summary>
        public float Saturation
        {
            get { return effect.Parameters["saturationCoefficient"].GetValueSingle(); }
            set { effect.Parameters["saturationCoefficient"].SetValue(value); }
        }

        /// <summary>
        /// Przygotuj shader do działania
        /// </summary>
        /// <param name="graphics">Menadżer wyświetlania</param>
        /// <param name="content">Menadżer danych</param>
        override public void Prepare(GraphicsDeviceManager graphics, ContentManager content)
        {
            effect = content.Load<Effect>(ShadersConfig.SHADERS_PATH + @"postprocess").Clone();
            effect.CurrentTechnique = effect.Techniques[3];
            base.Prepare(graphics, content);
        }
    }
}
